#%RAML 1.0

    title: Party API
    baseUri: http://localhost:8081
    version: v1
    
    documentation:
      - title: mod-party API
        content: This documents the API calls that can be made to post party for users, and to get them
    
    types:
      attend: !include attend.json
      attendCollection: !include attendCollection.json
      errors: !include raml-util/schemas/errors.schema
    
    traits:
      validate: !include raml-util/traits/validation.raml
      language: !include raml-util/traits/language.raml
      pageable:  !include raml-util/traits/pageable.raml
      searchable: !include raml-util/traits/searchable.raml


    resourceTypes:
      collection: !include raml-util/rtypes/collection.raml
      collection-item: !include raml-util/rtypes/item-collection.raml
    
    /party/attend:
      displayName: attend
      description: 从系统获取读者的签到记录
      type:
        collection:
          schemaCollection: attendCollection
          schemaItem: attend
          exampleCollection: !include examples/attendCollection.sample
          exampleItem: !include examples/attend.sample
    
      post:
        is: [validate]
      get:
        is: [
          searchable: {description: "根据条件查询读者的签到列表", example: " query = '' "},
          pageable,
          validate,
         ]


      /to/export_excel:
             get:
              description: "excel下载"
              is: [
                        searchable: {description: "根据相关条件查询读者签到记录并且导出为excel", example: "query = null"},
                        pageable,
                        validate
                      ]
              responses:
                200:
                  description: "下载文件成功"
                  body:
                    application/octet-stream:
                400:
                  description: "Bad request"
                  body:
                    text/plain:
                      example: "Bad request"
                500:
                  description: "Internal server error"
                  body:
                    text/plain:
                      example: "Internal server error"



      /attend_batch_update:
         post:
           description: Create a new <<resourcePathName|!singularize>> item.
           body:
             application/json:
              type: attend
              example:
                 strict: false
                 value: !include examples/attend.sample
           responses:
             201:
               description: "Returns a newly created item, with server-controlled fields like 'id' populated"
               headers:
                 Location:
                   description: URI to the created <<resourcePathName|!singularize>> item
               body:
                 application/json:
                   example: !include examples/attend.sample
             400:
               description: "Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response."
               body:
                 text/plain:
                   example: |
                     "unable to add <<resourcePathName|!singularize>> -- malformed JSON at 13:3"
             401:
               description: "Not authorized to perform requested action"
               body:
                 text/plain:
                   example: "unable to create <<resourcePathName>> -- unauthorized"
             500:
               description: "Internal server error, e.g. due to misconfiguration"
               body:
                 text/plain:
                   example: "Internal server error, contact administrator"
      /{id}:
          displayName: attend
          description: Get, Delete or Update a specific attend
          type:
             collection-item:
               schema: attend
               exampleItem: !include examples/attend.sample